#ifndef MANAGER_H
#define MANAGER_H
#include <QVector>
#include "person.h"
#include "managementmanager.h"
#include "student.h"
#include "teacher.h"
#include "course.h"

class manager:public person,public managerManagement
{
public:
    manager();

    void setInfo(QString name,QString id,QString password);

    int whoAreYou(QString id);

    QList<course>& getWaitToLoadCourse();

    QStringList getAllInfo();
    //实例化接口

    //把相关信息显示到表格
    virtual void displayAllStudent(QStandardItemModel *model);

    virtual void displayAllTeacher(QStandardItemModel *model);

    virtual void displayAllCourse(QStandardItemModel *model);

    virtual void checkMyInfo(QStandardItemModel *model);

    virtual bool displayCourseWithId(const QString& id,QStandardItemModel *model);

    virtual bool displayCourseWithName(const QString& name,QStandardItemModel *model);

    virtual bool displayTeacherWithId(const QString& id,QStandardItemModel *model);

    virtual bool displayTeacherWithName(const QString& name,QStandardItemModel *model);

    virtual bool displayStudentWithId(const QString& id,QStandardItemModel *model);

    virtual bool displayStudentWithName(const QString& name,QStandardItemModel *model);

    virtual void displayWaitToLoadCourse(QStandardItemModel *model);

    //添加相关信息
    virtual void addNewCourse(course& newCourse);

    virtual void addNewStudent(student& newStudent);

    virtual void addNewTeacher(teacher& newTeacher);

    //修改密码
    virtual bool modifyPassword(QString oldPassword,QString newPassword);

    //修改相关信息
    virtual void modifyStudentInfo(student& info,QStringList newInfo);

    virtual void modifyCourseInfo(course& info,QStringList newInfo);

    virtual void modifyTeacherInfo(teacher& info,QStringList newInfo);

    //删除相关信息
    virtual void deleteStudentInfo(QString id);

    virtual void deleteTeacherInfo(QString id);

    virtual void deleteCourseInfo(QString id);

    //查找相关信息
    virtual teacher& findTeacherWithId(const QString& id);

    virtual teacher& findTeacherWithName(const QString& name);

    virtual student& findStudentWithId(const QString& id);

    virtual student& findStudentWithName(const QString& name);

    virtual course& findCourseWithId(const QString &id);

    //保存文件
    virtual void saveAllInfo();

private:
    QList<student> stuInfo;
    QList<teacher> teaInfo;
    QList<course> couInfo;
    QList<course> waitToLoadCourse;
    QString adminPassword;
};

#endif // MANAGER_H
